#ifndef FORMCARREGAPERFIL_H_
#define FORMCARREGAPERFIL_H_

#include <FBase.h>
#include <FUi.h>
#include <FMedia.h>
#include <FGraphics.h>
#include "view/FormMgr.h"
#include "db/DatabaseManager.h"
#include "db/InfoDB.h"

using namespace Osp::Ui;
using namespace Osp::Ui::Controls;
using namespace Osp::Base::Collection;

class FormCarregaPerfil :
	public Form,
	public IActionEventListener,
	public IItemEventListener
{

// Construction
public:
	FormCarregaPerfil(void);
	virtual ~FormCarregaPerfil(void);
	bool Initialize(void);

// Implementation
protected:
	static const int ID_CONTEXTMENU_LOAD = 101;
	static const int ID_CONTEXTMENU_DELETE = 102;
	static const int ID_BTN_SHOW_CONTEXTMENU = 103;
	static const int ID_BUTTON_VOLTAR = 104;
	static const int ID_BUTTON_LIMPAR = 105;

	static const int ID_BASE_LISTA = 200;

	Osp::Ui::Controls::Button *__pButtonVoltar;
	Osp::Ui::Controls::Button *__pButtonLimpar;

public:
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	virtual result OnDraw(void);

	virtual void OnItemStateChanged(const Osp::Ui::Control &source, int index, int itemId, Osp::Ui::ItemStatus status);


private:
	void RetrievePlayers();
	void CarregarPerfil();
	Osp::Ui::Controls::ContextMenu *__pContextMenu;
	List* __pList;
	ArrayList* perfis;
	InfoDB* perfilSelecionado;
	int indexSelecionado;
};

#endif	//_FORMCARREGAPERFIL_H_
